/* global React */
// GT7 League site shell — routes between screens.
function App() {
  const [tab, setTab] = React.useState('This Week');
  const screens = {
    'This Week': <window.DashboardScreen setTab={setTab} />,
    Setup: <window.SeasonSetupScreen />,
    Season: <window.ScheduleScreen setTab={setTab} />,
    Standings: <window.StandingsScreen />,
    Results: <window.ResultsScreen />,
    Vote: <window.VoteScreen />,
    Generator: <window.RaceGeneratorScreen />,
    Catalog: <window.Gt7CatalogScreen />,
    Build: <window.RoundBuilderScreen />,
  };
  return (
    <div style={{ minHeight: '100vh', background: 'var(--bg-app)', display: 'flex', flexDirection: 'column' }}>
      <window.SiteHeader tab={tab} setTab={setTab} />
      <main style={{ width: '100%', maxWidth: 'var(--container-max)', margin: '0 auto', padding: '32px 28px 56px', flex: 1 }}>
        {screens[tab]}
      </main>
      <footer style={{ width: '100%', maxWidth: 'var(--container-max)', margin: '0 auto', padding: '0 28px 28px', color: 'var(--text-muted)', fontSize: '13px', textAlign: 'center' }}>
        Built by Arnhem Advies LLC
      </footer>
    </div>
  );
}
window.App = App;
